.class public Lrexsee/multimedia/RexseeCamera;
.super Ljava/lang/Object;
.source "RexseeCamera.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final EVENT_ONTAKEPICTUREFAILED:Ljava/lang/String; = "onTakePictureFailed"

.field public static final EVENT_ONTAKEPICTURESUCCESSED:Ljava/lang/String; = "onTakePictureSuccessed"

.field public static final EVENT_ONTAKEVIDEOFAILED:Ljava/lang/String; = "onTakeVideoFailed"

.field public static final EVENT_ONTAKEVIDEOSUCCESSED:Ljava/lang/String; = "onTakeVideoSuccessed"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "Camera"

.field public static final URI_MEDIA_IMAGE:Ljava/lang/String; = "content://media/external/images/media"

.field public static final URI_MEDIA_VIDEO:Ljava/lang/String; = "content://media/external/video/media"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private mIntentTime:J

.field private mediaFile:Ljava/lang/String;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 4
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 49
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 44
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 46
    const-wide/16 v0, -0x1

    iput-wide v0, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    .line 51
    iput-object p1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    .line 52
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureSuccessed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 53
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureFailed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 54
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoSuccessed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 55
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoFailed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 57
    iget-object v0, p1, Lrexsee/core/browser/Browser;->urlListeners:Lrexsee/core/browser/RexseeUrl;

    new-instance v1, Lrexsee/multimedia/RexseeCamera$1;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":images"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, p0, v2}, Lrexsee/multimedia/RexseeCamera$1;-><init>(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeUrl;->add(Lrexsee/core/browser/clazz/UrlListener;)V

    .line 90
    iget-object v0, p1, Lrexsee/core/browser/Browser;->urlListeners:Lrexsee/core/browser/RexseeUrl;

    new-instance v1, Lrexsee/multimedia/RexseeCamera$2;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":video"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, p0, v2}, Lrexsee/multimedia/RexseeCamera$2;-><init>(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeUrl;->add(Lrexsee/core/browser/clazz/UrlListener;)V

    .line 124
    return-void
.end method

.method static synthetic access$0(Lrexsee/multimedia/RexseeCamera;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 48
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    .prologue
    .line 126
    invoke-direct {p0, p1}, Lrexsee/multimedia/RexseeCamera;->contentToPath(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$2(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    .prologue
    .line 145
    invoke-direct {p0, p1, p2}, Lrexsee/multimedia/RexseeCamera;->returnPic(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$3(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;)Z
    .locals 1

    .prologue
    .line 141
    invoke-direct {p0, p1}, Lrexsee/multimedia/RexseeCamera;->isValidResult(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method static synthetic access$4(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    .prologue
    .line 167
    invoke-direct {p0, p1, p2}, Lrexsee/multimedia/RexseeCamera;->returnVideo(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method private contentToPath(Ljava/lang/String;)Ljava/lang/String;
    .locals 10
    .param p1, "content"    # Ljava/lang/String;

    .prologue
    const/4 v9, 0x0

    const/4 v3, 0x0

    .line 127
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    .line 128
    .local v0, "contentResolver":Landroid/content/ContentResolver;
    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/String;

    const-string v4, "_data"

    aput-object v4, v2, v9

    const-string v5, "_id desc"

    move-object v4, v3

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 129
    .local v6, "cursor":Landroid/database/Cursor;
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I

    move-result v1

    if-nez v1, :cond_1

    :cond_0
    move-object v1, v3

    .line 138
    :goto_0
    return-object v1

    .line 130
    :cond_1
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    .line 131
    new-instance v7, Ljava/io/File;

    invoke-interface {v6, v9}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v7, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 132
    .local v7, "file":Ljava/io/File;
    invoke-virtual {v7}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_2

    iget-wide v1, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    const-wide/16 v4, 0x0

    cmp-long v1, v1, v4

    if-lez v1, :cond_2

    invoke-virtual {v7}, Ljava/io/File;->lastModified()J

    move-result-wide v1

    iget-wide v4, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    cmp-long v1, v1, v4

    if-lez v1, :cond_2

    .line 133
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "file://"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-interface {v6, v9}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    .line 134
    .local v8, "rtn":Ljava/lang/String;
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    move-object v1, v8

    .line 135
    goto :goto_0

    .line 137
    .end local v8    # "rtn":Ljava/lang/String;
    :cond_2
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    move-object v1, v3

    .line 138
    goto :goto_0
.end method

.method private isValidResult(Ljava/lang/String;)Z
    .locals 5
    .param p1, "path"    # Ljava/lang/String;

    .prologue
    .line 142
    new-instance v0, Ljava/io/File;

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    invoke-virtual {v1}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 143
    .local v0, "file":Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_0

    iget-wide v1, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    const-wide/16 v3, 0x0

    cmp-long v1, v1, v3

    if-lez v1, :cond_0

    invoke-virtual {v0}, Ljava/io/File;->lastModified()J

    move-result-wide v1

    iget-wide v3, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    cmp-long v1, v1, v3

    if-lez v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method private returnPic(Ljava/lang/String;Ljava/lang/String;)V
    .locals 6
    .param p1, "output"    # Ljava/lang/String;
    .param p2, "path"    # Ljava/lang/String;

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    const/4 v1, 0x0

    const-string v5, "onTakePictureSuccessed"

    const-string v2, "onTakePictureFailed"

    .line 146
    if-nez p1, :cond_0

    .line 147
    iput-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 148
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureFailed"

    invoke-virtual {v0, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    .line 166
    :goto_0
    return-void

    .line 149
    :cond_0
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 150
    iput-object p2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 151
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureSuccessed"

    new-array v1, v4, [Ljava/lang/String;

    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    aput-object v2, v1, v3

    invoke-virtual {v0, v5, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    .line 153
    :cond_1
    invoke-direct {p0, p1}, Lrexsee/multimedia/RexseeCamera;->isValidResult(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 154
    invoke-static {p1, p2}, Lrexsee/core/utilities/Utilities;->copy(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 155
    iput-object p2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 156
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureSuccessed"

    new-array v1, v4, [Ljava/lang/String;

    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    aput-object v2, v1, v3

    invoke-virtual {v0, v5, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    .line 158
    :cond_2
    iput-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 159
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureFailed"

    invoke-virtual {v0, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    goto :goto_0

    .line 162
    :cond_3
    iput-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 163
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakePictureFailed"

    invoke-virtual {v0, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    goto :goto_0
.end method

.method private returnVideo(Ljava/lang/String;Ljava/lang/String;)V
    .locals 6
    .param p1, "output"    # Ljava/lang/String;
    .param p2, "path"    # Ljava/lang/String;

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    const/4 v1, 0x0

    const-string v5, "onTakeVideoSuccessed"

    const-string v2, "onTakeVideoFailed"

    .line 168
    if-nez p1, :cond_0

    .line 169
    iput-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 170
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoFailed"

    invoke-virtual {v0, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    .line 188
    :goto_0
    return-void

    .line 171
    :cond_0
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 172
    iput-object p2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 173
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoSuccessed"

    new-array v1, v4, [Ljava/lang/String;

    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    aput-object v2, v1, v3

    invoke-virtual {v0, v5, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    .line 175
    :cond_1
    invoke-direct {p0, p1}, Lrexsee/multimedia/RexseeCamera;->isValidResult(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 176
    invoke-static {p1, p2}, Lrexsee/core/utilities/Utilities;->copy(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 177
    iput-object p2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 178
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoSuccessed"

    new-array v1, v4, [Ljava/lang/String;

    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    aput-object v2, v1, v3

    invoke-virtual {v0, v5, v1}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    .line 180
    :cond_2
    iput-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 181
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoFailed"

    invoke-virtual {v0, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    goto :goto_0

    .line 184
    :cond_3
    iput-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    .line 185
    iget-object v0, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTakeVideoFailed"

    invoke-virtual {v0, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    goto :goto_0
.end method


# virtual methods
.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 29
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 25
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Camera"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 33
    new-instance v0, Lrexsee/multimedia/RexseeCamera;

    invoke-direct {v0, p1}, Lrexsee/multimedia/RexseeCamera;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public prepareUpload()V
    .locals 4

    .prologue
    .line 323
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    const-string v2, ""

    if-ne v1, v2, :cond_1

    .line 324
    :cond_0
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "Picture or video is not ready."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 333
    :goto_0
    return-void

    .line 326
    :cond_1
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->interfaceList:Lrexsee/core/browser/clazz/JavascriptInterfaceList;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "Upload"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lrexsee/core/browser/clazz/JavascriptInterfaceList;->get(Ljava/lang/String;)Lrexsee/core/browser/clazz/JavascriptInterface;

    move-result-object v0

    check-cast v0, Lrexsee/core/transportation/RexseeUpload;

    .line 327
    .local v0, "uploadObject":Lrexsee/core/transportation/RexseeUpload;
    if-nez v0, :cond_2

    .line 328
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "Upload object is not ready."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 330
    :cond_2
    iget-object v1, v0, Lrexsee/core/transportation/RexseeUpload;->selectedFiles:Ljava/util/ArrayList;

    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method public takePicture()V
    .locals 1

    .prologue
    .line 193
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeCamera;->takePicture(I)V

    .line 194
    return-void
.end method

.method public takePicture(I)V
    .locals 4
    .param p1, "quality"    # I

    .prologue
    .line 197
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.media.action.IMAGE_CAPTURE"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 198
    .local v1, "intent":Landroid/content/Intent;
    const-string v2, "android.intent.extra.videoQuality"

    if-nez p1, :cond_0

    const/4 v3, 0x0

    :goto_0
    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 199
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    .line 200
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->activityResult:Lrexsee/core/browser/clazz/ActivityResult;

    new-instance v3, Lrexsee/multimedia/RexseeCamera$3;

    invoke-direct {v3, p0}, Lrexsee/multimedia/RexseeCamera$3;-><init>(Lrexsee/multimedia/RexseeCamera;)V

    invoke-virtual {v2, v1, v3}, Lrexsee/core/browser/clazz/ActivityResult;->start(Landroid/content/Intent;Lrexsee/core/browser/clazz/ActivityResult$ActivityResultListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 222
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_1
    return-void

    .line 198
    .restart local v1    # "intent":Landroid/content/Intent;
    :cond_0
    const/4 v3, 0x1

    goto :goto_0

    .line 219
    .end local v1    # "intent":Landroid/content/Intent;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 220
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_1
.end method

.method public takePicture(ILjava/lang/String;)V
    .locals 4
    .param p1, "quality"    # I
    .param p2, "path"    # Ljava/lang/String;

    .prologue
    .line 225
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.media.action.IMAGE_CAPTURE"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 226
    .local v1, "intent":Landroid/content/Intent;
    const-string v2, "android.intent.extra.videoQuality"

    if-nez p1, :cond_0

    const/4 v3, 0x0

    :goto_0
    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 227
    const-string v2, "output"

    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 228
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    .line 229
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->activityResult:Lrexsee/core/browser/clazz/ActivityResult;

    new-instance v3, Lrexsee/multimedia/RexseeCamera$4;

    invoke-direct {v3, p0, p2}, Lrexsee/multimedia/RexseeCamera$4;-><init>(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;)V

    invoke-virtual {v2, v1, v3}, Lrexsee/core/browser/clazz/ActivityResult;->start(Landroid/content/Intent;Lrexsee/core/browser/clazz/ActivityResult$ActivityResultListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 255
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_1
    return-void

    .line 226
    .restart local v1    # "intent":Landroid/content/Intent;
    :cond_0
    const/4 v3, 0x1

    goto :goto_0

    .line 252
    .end local v1    # "intent":Landroid/content/Intent;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 253
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_1
.end method

.method public takeVideo()V
    .locals 1

    .prologue
    .line 258
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeCamera;->takeVideo(I)V

    .line 259
    return-void
.end method

.method public takeVideo(I)V
    .locals 4
    .param p1, "quality"    # I

    .prologue
    .line 262
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.media.action.VIDEO_CAPTURE"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 263
    .local v1, "intent":Landroid/content/Intent;
    const-string v2, "android.intent.extra.videoQuality"

    if-nez p1, :cond_0

    const/4 v3, 0x0

    :goto_0
    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 264
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    .line 265
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->activityResult:Lrexsee/core/browser/clazz/ActivityResult;

    new-instance v3, Lrexsee/multimedia/RexseeCamera$5;

    invoke-direct {v3, p0}, Lrexsee/multimedia/RexseeCamera$5;-><init>(Lrexsee/multimedia/RexseeCamera;)V

    invoke-virtual {v2, v1, v3}, Lrexsee/core/browser/clazz/ActivityResult;->start(Landroid/content/Intent;Lrexsee/core/browser/clazz/ActivityResult$ActivityResultListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 287
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_1
    return-void

    .line 263
    .restart local v1    # "intent":Landroid/content/Intent;
    :cond_0
    const/4 v3, 0x1

    goto :goto_0

    .line 284
    .end local v1    # "intent":Landroid/content/Intent;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 285
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_1
.end method

.method public takeVideo(ILjava/lang/String;)V
    .locals 4
    .param p1, "quality"    # I
    .param p2, "path"    # Ljava/lang/String;

    .prologue
    .line 290
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.media.action.VIDEO_CAPTURE"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 291
    .local v1, "intent":Landroid/content/Intent;
    const-string v2, "android.intent.extra.videoQuality"

    if-nez p1, :cond_0

    const/4 v3, 0x0

    :goto_0
    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 292
    const-string v2, "output"

    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 293
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, p0, Lrexsee/multimedia/RexseeCamera;->mIntentTime:J

    .line 294
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v2, v2, Lrexsee/core/browser/Browser;->activityResult:Lrexsee/core/browser/clazz/ActivityResult;

    new-instance v3, Lrexsee/multimedia/RexseeCamera$6;

    invoke-direct {v3, p0, p2}, Lrexsee/multimedia/RexseeCamera$6;-><init>(Lrexsee/multimedia/RexseeCamera;Ljava/lang/String;)V

    invoke-virtual {v2, v1, v3}, Lrexsee/core/browser/clazz/ActivityResult;->start(Landroid/content/Intent;Lrexsee/core/browser/clazz/ActivityResult$ActivityResultListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 320
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_1
    return-void

    .line 291
    .restart local v1    # "intent":Landroid/content/Intent;
    :cond_0
    const/4 v3, 0x1

    goto :goto_0

    .line 317
    .end local v1    # "intent":Landroid/content/Intent;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 318
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_1
.end method

.method public upload(Ljava/lang/String;Ljava/lang/String;)V
    .locals 4
    .param p1, "action"    # Ljava/lang/String;
    .param p2, "name"    # Ljava/lang/String;

    .prologue
    .line 336
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    const-string v2, ""

    if-ne v1, v2, :cond_1

    .line 337
    :cond_0
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "Picture or video is not ready."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 348
    :goto_0
    return-void

    .line 339
    :cond_1
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->interfaceList:Lrexsee/core/browser/clazz/JavascriptInterfaceList;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "Upload"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lrexsee/core/browser/clazz/JavascriptInterfaceList;->get(Ljava/lang/String;)Lrexsee/core/browser/clazz/JavascriptInterface;

    move-result-object v0

    check-cast v0, Lrexsee/core/transportation/RexseeUpload;

    .line 340
    .local v0, "uploadObject":Lrexsee/core/transportation/RexseeUpload;
    if-nez v0, :cond_2

    .line 341
    iget-object v1, p0, Lrexsee/multimedia/RexseeCamera;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeCamera;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "Upload object is not ready."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 343
    :cond_2
    invoke-virtual {v0}, Lrexsee/core/transportation/RexseeUpload;->clear()V

    .line 344
    iget-object v1, v0, Lrexsee/core/transportation/RexseeUpload;->selectedFiles:Ljava/util/ArrayList;

    iget-object v2, p0, Lrexsee/multimedia/RexseeCamera;->mediaFile:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 345
    invoke-virtual {v0, p1, p2}, Lrexsee/core/transportation/RexseeUpload;->upload(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method
